<?php
/**
 * www.zhuizhan.com.
 * User: junyv
 * Date: 14-11-22 下午3:30
 */
namespace Admin\Model;
use Think\Model\RelationModel;
class IntegralRecordModel extends RelationModel
{
    //关联关系

    protected $_link = array(
        'user'=>array(
            'mapping_type'=>self::BELONGS_TO,
            'foreign_key'=>'user_id',
            'mapping_fields'=>'username',	//要取出的字段
            'as_fields'=>'username:user_name'	//使用别名
        )
    );
}